// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from 'vue'
import moment from 'moment'
import App from './App'
import router from './router'

import Api from './helper/Api'
import Strings from './helper/Strings'
import Session from './helper/Session'
import './assets/css/styles.css'
import './assets/css/managestyle.css'
//MintUI
import MintUI from 'mint-ui'
import 'mint-ui/lib/style.css'

//全局文字常量
Vue.prototype.Strings = Strings
//全局Api
Vue.prototype.Api = Api
// Session
Vue.prototype.Session = Session


Vue.config.productionTip = false

Vue.use(MintUI)

Vue.prototype.$toast = MintUI.Toast
Vue.prototype.$indicator = MintUI.Indicator
Vue.prototype.$messageBox = MintUI.MessageBox

//Time Filter
Vue.filter('Date', (timestamp) => {
	return moment(timestamp * 1).format('YYYY/MM/DD');
});
Vue.filter('Time', (timestamp) => {
	return moment(timestamp * 1).format('HH:mm');
});
Vue.filter('DateTime', (timestamp) => {
	return moment(timestamp * 1).format('YYYY/MM/DD HH:mm');
});

/* eslint-disable no-new */
new Vue({
  el: '#app',
  router,
  render: h => h(App)
}).$mount('#app');